
<header class="uc_head">
	<h3>退款申请</h3>
</header>
<section class="user_form">
	<form action="{url:/ucenter/refunds_update}" method="post" callback="checkForm();">
		<input type="hidden" name="order_id" value="{$this->orderRow['id']}" />
		<dl>
			<dt>订单号：</dt>
			<dd>{$this->orderRow['order_no']}</dd>
			</dl>

			<dl>
			<dt>退款商品：</dt>
			<dd>
				{foreach:items=Api::run('getOrderGoodsListByGoodsid',array('#order_id#',$this->orderRow['id'])) item=$good}
				{set:$good_info = JSON::decode($good['goods_array'])}
				{if:$good['is_send'] != 2}
				<p>
					<label>
						<input type="checkbox" name="order_goods_id[]" value="{$good['id']}" />
						<a class="blue" href="{url:/site/products/id/$good['goods_id']}" target='_blank'>{$good_info['name']}{if:$good_info['value']}{$good_info['value']}{/if} X {$good['goods_nums']}件</a>
					</label>
				</p>
				{/if}
				{/foreach}
			</dd>
			</dl>

			<dl>
			<dt>退款理由：</dt>
			<dd>
				<textarea class="input_textarea" name="content" id="content" pattern="required"></textarea>
				<label>请写明退款理由，上传问题商品图片</label>
			</dd>
			</dl>
		<dl>
			<dt></dt>
			<dd>
				<input class="input_submit" type="submit" value="提交退款" />
			</dd>
		</dl>
	</form>
</section>

<script>


//提交表单检查
function checkForm()
{
	if($('#content').val() == '')
	{
		alert('请填写退款原因');
		return false;
	}

	if($('[name="order_goods_id[]"]:checked').length == 0)
	{
		alert('请选择要退款的商品');
		return false;
	}
	return true;
}
</script>